﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );



$session =& JFactory::getSession();
$seyretmessagetype=$session->get('seyret.messagetype');
$seyretmessage=$this->seyretmessage($seyretmessagetype);
$session->clear('seyret.messagetype');


$samectgvideolist=$this->videoListInCat;
$user =& JFactory::getUser();





?>


			<!-- START: Same Category Videos -->
			<div id="samecategoryvideosbox_js">
				<div id="videocategorytitle">
					<?php echo JText::_('Category');?>
				</div>
				
				<div id="samecategoryvideosbuttons">
					<div id="scvdisplayswitcher">
						<?php
						
							//create switch button here
							if ($this->scvdisplay=="oc") {
							?>
							<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=video&id=".$this->videoid."&scvds=multi");?>">
								<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchmulti.png";?>" alt="" />
							</a>
							
							<?php
							
							} else {
							?>
							<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=video&id=".$this->videoid."&scvds=oc");?>">
								<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchoc.png";?>" alt="" />
							</a>
							
							<?php							
							}
						
						?>

					</div>
					<div style="float:right;"><?php echo $this->videocategorylister;?></div>
					<div style="clear:both;"></div>
				</div>
				
				
				
				<div id="samecategoryvideoslist">
					<?php 

						//Create video list in same category
						
						//generate one column view
						if ($this->scvdisplay == "oc") {
							foreach ($samectgvideolist as $samectgvideolist) {
								$safevideotitle = str_replace("'", "\'", $samectgvideolist->videotitle);
								$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);
								
								$playlistenabled=false;
								if ($this->registry->getValue('seyret.vsplugins.'.str_replace(".", "", $samectgvideolist->videoservertype))=="1") $playlistenabled=true;
								
								//quick list
								$inql = false;
								if (in_array($samectgvideolist->id, $this->quicklistarray)) {
									$inql = true;			
								}


								?>
							



								<div class="samecategoryvideoslistrow">
								
									<div class="videothumbscvdiv">
										<a href="<?php echo $samectgvideolist->videolink ; ?>" class="videolink">
											<img class="videothumbscv" src="<?php echo htmlentities($samectgvideolist->videothumbnail);?>" alt="" />
										</a>
										<div id="addtoqlbdiv<?php echo $samectgvideolist->id; ?>" style="margin-top:-27px; padding-left:7px; z-index:9999;">

											<img id="scaddtoqlimg_js_<?php echo $samectgvideolist->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $samectgvideolist->id; ?>', '<?php echo htmlentities($samectgvideolist->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $samectgvideolist->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false&&$playlistenabled==true)? 'visible' : 'hidden';?>;"/>
											<img id="scaddtoqlimg_js_rem<?php echo $samectgvideolist->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

										</div>
										<div class="watchpagelistdurationdivmc"><?php echo $samectgvideolist->duration;?>
										</div>
	
									</div>
									

									<div style="float:left;">
										<div class="watchpagelistvideotitlediv">
											<a href="<?php echo $samectgvideolist->videolink; ?>" class="videolink">
											<?php echo $samectgvideolist->videotitle; ?>
											</a>
										</div>

										
										<div class="watchpagelistownerdiv">
											<?php echo JText::_('Owner').": ";?><a href="<?php echo $this->absURL("index.php?option=com_seyret&view=user&id=".$samectgvideolist->addedby); ?>" class="editbuttonlink"><?php echo $samectgvideolist->username; ?></a>
										</div>
										
										<div  class="watchpagelistviewsdiv">
											<?php echo JText::_('Views').": ".$samectgvideolist->hits; ?>
										</div>		

										<div  class="watchpagelistaddeddatediv">
											<?php echo JText::_('Date').": ".$samectgvideolist->addeddate; ?>
										</div>											
									</div>
								
								
								</div>
								
								<div style="clear:both;"></div>
								
								
								<?php
							}						
						} else {
						//generate multicolumn view
						
							$sccolumn=1;
							foreach ($samectgvideolist as $samectgvideolist) {
								$safevideotitle = str_replace("'", "\'", $samectgvideolist->videotitle);
								$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);
								
								
								$playlistenabled=false;
								if ($this->registry->getValue('seyret.vsplugins.'.str_replace(".", "", $samectgvideolist->videoservertype))=="1") $playlistenabled=true;
								
								$inql = false;
								if (in_array($samectgvideolist->id, $this->quicklistarray)) {
									$inql = true;			
								}

							
							?>
								<div class="scvvideomulticblock">
								
									<div class="videothumbscvdiv">
										<a href="<?php echo $samectgvideolist->videolink ; ?>" class="videolink">
											<img class="videothumbscv" src="<?php echo htmlentities($samectgvideolist->videothumbnail);?>" alt="" />
										</a>
										<div id="addtoqlbdiv<?php echo $samectgvideolist->id; ?>" style="margin-top:-27px; padding-left:7px; z-index:9999;">
											<img id="scaddtoqlimg_js_<?php echo $samectgvideolist->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $samectgvideolist->id; ?>', '<?php echo htmlentities($samectgvideolist->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $samectgvideolist->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false&&$playlistenabled==true) ? 'visible' : 'hidden';?>;"/>
											<img id="scaddtoqlimg_js_rem<?php echo $samectgvideolist->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>
										</div>
										
										<div class="watchpagelistdurationdivmc"><?php echo $samectgvideolist->duration;?>
										</div>
										
									</div>
									<div style="clear:both;"></div>
									
									<div>
										<div class="videotitlescvmulti">
											<a href="<?php echo $samectgvideolist->videolink ; ?>"  class="videolink">
											<?php echo $samectgvideolist->videotitle; ?>
											</a>
										</div>
									
									</div>				
								
								
								</div>
								
													
							
							
							<?php
							
							$sccolumn++;
							if ($sccolumn>3) {
								echo "<div style=\"clear:both;\"></div>	";
								$sccolumn=1;
							}
							
							}
						
						
						}

					
					
					?>
					<div style="clear:both;"></div>	
					<div class="categoryvideocountbox"><a href="<?php echo $this->absURL("index.php?option=com_seyret&view=category&task=videos&id=".$this->categoryid);?>"><?php echo JText::sprintf('See all %s videos in this category', $this->totalcatvidrowcount);?></a></div>
				</div>
				
			
			</div>
			<!-- END: Same Category Videos -->